Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding compression to JPEG image types #253

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ramanakumars
Copy link
Collaborator

Adding a --compress option to the CLI for subject-set upload-subjects to automatically compress JPEG images during the upload. Currently this is the only format that works consistently; PNG compression requires image size scaling rather than quality based compression.

The compression code starts at 80% quality and successively reduces to 50% before throwing an error if the file size is still too large. For a ~2-3MB it seems like 2 iterations is enough for getting below the current 1MB limit so this should not take too long.

@@ -17,6 +17,7 @@
packages=find_packages(),
include_package_data=True,
install_requires=[
'Pillow>=5.4.0,<=7.0.0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting that we should probably bump the version to 1.2 (rather than staying at 1.1.x) for the next release since Pillow is a relatively big dependency to add.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! If this is approved, I can commit the update to setup.py to bump the version number. Is there anywhere else that this needs to be changed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^ @zwolf ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll be handled in a separate version release PR. If this feature needs the new version, update it here and I'll handle the new version release when this merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants